package sns.websocketservlet;

import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.http.HttpServletRequest;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;
import sns.app.shoot3d.Shoot3DMessageInbound;

public class Shooting3DWebSocketServlet extends WebSocketServlet {

	private static final long serialVersionUID = 1L;
	private static final AtomicInteger connectionIds = new AtomicInteger(0);
	private static final ArrayList<Shoot3DMessageInbound> connections = new ArrayList<Shoot3DMessageInbound>();

	@Override
	protected StreamInbound createWebSocketInbound(String subProtocol,
			HttpServletRequest request) {
		// TODO DEBUG
		return new Shoot3DMessageInbound(connectionIds.incrementAndGet(),connections);
	}

}
